<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>虚拟货币查询工具</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        .container {
            max-width: 600px;
            margin-top: 50px;
        }
        
        .search-card {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        
        .crypto-card {
            background: linear-gradient(135deg, #1e2a3a 0%, #2d3b50 100%);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            color: white;
            overflow: hidden;
            transition: all 0.3s ease;
            margin-top: 30px;
            border: none;
        }
        
        .crypto-card:hover {
            transform: translateY(-10px);
            box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
        }
        
        .card-header {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            padding: 20px;
            position: relative;
            overflow: hidden;
        }
        
        .card-header::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
            opacity: 0.3;
        }
        
        .pair-info {
            position: relative;
            z-index: 1;
        }
        
        .pair-symbol {
            font-size: 1.5rem;
            font-weight: 700;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .pair-name {
            font-size: 0.9rem;
            opacity: 0.8;
            margin: 5px 0 0 0;
        }
        
        .price-section {
            padding: 30px 20px 20px;
            text-align: center;
        }
        
        .current-price {
            font-size: 3rem;
            font-weight: 800;
            margin-bottom: 15px;
            background: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .price-change {
            font-size: 1.2rem;
            padding: 8px 16px;
            border-radius: 25px;
            font-weight: 600;
            display: inline-block;
            margin-bottom: 20px;
        }
        
        .change-positive {
            background: rgba(0, 200, 83, 0.2);
            color: #00c853;
            border: 2px solid rgba(0, 200, 83, 0.3);
        }
        
        .change-negative {
            background: rgba(255, 55, 95, 0.2);
            color: #ff375f;
            border: 2px solid rgba(255, 55, 95, 0.3);
        }
        
        .additional-info {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 20px;
            padding: 0 20px 25px;
        }
        
        .info-item {
            text-align: center;
            padding: 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .info-label {
            font-size: 0.8rem;
            opacity: 0.7;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        .info-value {
            font-size: 1.1rem;
            font-weight: 600;
        }
        
        .search-form {
            padding: 30px;
        }
        
        .form-control {
            border-radius: 15px;
            border: 2px solid rgba(102, 126, 234, 0.2);
            padding: 15px 20px;
            font-size: 1.1rem;
            transition: all 0.3s ease;
        }
        
        .form-control:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
        }
        
        .btn-search {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            border-radius: 15px;
            padding: 15px 30px;
            font-weight: 600;
            transition: all 0.3s ease;
        }
        
        .btn-search:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }
        
        .error-alert {
            background: rgba(255, 55, 95, 0.1);
            border: 2px solid rgba(255, 55, 95, 0.3);
            color: #ff375f;
            border-radius: 15px;
            margin-top: 20px;
        }
        
        .last-updated {
            text-align: center;
            padding: 15px;
            font-size: 0.8rem;
            opacity: 0.6;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .loading {
            display: none;
            text-align: center;
            margin-top: 20px;
        }
        
        .spinner {
            border: 3px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            border-top: 3px solid #667eea;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 15px;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .examples {
            margin-top: 15px;
            font-size: 0.9rem;
            color: #6c757d;
        }
        
        .example-tag {
            display: inline-block;
            background: rgba(102, 126, 234, 0.1);
            color: #667eea;
            padding: 4px 8px;
            border-radius: 8px;
            margin: 2px;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .example-tag:hover {
            background: rgba(102, 126, 234, 0.2);
            transform: translateY(-1px);
        }
        
        /* 技术分析样式 */
        .technical-analysis-section {
            margin-top: 25px;
            padding: 25px 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .section-header {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .section-header h4 {
            margin: 0;
            color: #00c9ff;
            font-size: 1.2rem;
        }
        
        .main-indicators {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
            gap: 15px;
            margin-bottom: 20px;
        }
        
        .indicator-card {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 15px 10px;
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.1);
            transition: all 0.3s ease;
        }
        
        .indicator-card:hover {
            background: rgba(255, 255, 255, 0.12);
            transform: translateY(-2px);
        }
        
        .indicator-name {
            font-size: 0.8rem;
            opacity: 0.8;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .indicator-value {
            font-size: 1.3rem;
            font-weight: 700;
            margin-bottom: 8px;
            color: #00c9ff;
        }
        
        .indicator-signal {
            font-size: 0.7rem;
            padding: 4px 8px;
            border-radius: 12px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .signal-bullish {
            background: rgba(0, 200, 83, 0.3);
            color: #00c853;
            border: 1px solid rgba(0, 200, 83, 0.5);
        }
        
        .signal-bearish {
            background: rgba(255, 55, 95, 0.3);
            color: #ff375f;
            border: 1px solid rgba(255, 55, 95, 0.5);
        }
        
        .signal-overbought {
            background: rgba(255, 152, 0, 0.3);
            color: #ff9800;
            border: 1px solid rgba(255, 152, 0, 0.5);
        }
        
        .signal-oversold {
            background: rgba(76, 175, 80, 0.3);
            color: #4caf50;
            border: 1px solid rgba(76, 175, 80, 0.5);
        }
        
        .signal-neutral {
            background: rgba(158, 158, 158, 0.3);
            color: #9e9e9e;
            border: 1px solid rgba(158, 158, 158, 0.5);
        }
        
        .detailed-indicators {
            background: rgba(255, 255, 255, 0.05);
            border-radius: 12px;
            padding: 15px;
            margin-bottom: 20px;
        }
        
        .detail-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 0;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .detail-item:last-child {
            border-bottom: none;
        }
        
        .detail-label {
            font-size: 0.9rem;
            opacity: 0.8;
        }
        
        .detail-value {
            font-weight: 600;
            color: #92fe9d;
        }
        
        .overall-signal {
            background: rgba(255, 255, 255, 0.08);
            border-radius: 12px;
            padding: 15px;
            text-align: center;
            margin-bottom: 15px;
        }
        
        .signal-title {
            font-size: 0.9rem;
            opacity: 0.8;
            margin-bottom: 10px;
        }
        
        .overall-signal-badge {
            display: inline-block;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.9rem;
            margin-bottom: 8px;
        }
        
        .signal-breakdown {
            font-size: 0.8rem;
            opacity: 0.7;
        }
        
        .analysis-info {
            text-align: center;
            padding-top: 10px;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="text-center mb-4">
            <h1 class="text-white mb-2">
                <i class="fas fa-coins me-2"></i>
                虚拟货币查询工具
            </h1>
            <p class="text-white-50">实时获取加密货币价格和市场数据</p>
        </div>
        
        <div class="card search-card">
            <form method="POST" class="search-form" id="searchForm">
                <div class="input-group mb-3">
                    <input type="text" name="coin" class="form-control" 
                           placeholder="输入货币代码 (例如: BTC, ETH, BTC/USDT)" 
                           required id="coinInput" autocomplete="off">
                    <button class="btn btn-search" type="submit">
                        <i class="fas fa-search me-2"></i>查询
                    </button>
                </div>
                
                <div class="examples">
                    <small>示例格式：</small>
                    <span class="example-tag" onclick="fillExample('BTC')">BTC</span>
                    <span class="example-tag" onclick="fillExample('ETH/USDT')">ETH/USDT</span>
                    <span class="example-tag" onclick="fillExample('ada')">ada</span>
                    <span class="example-tag" onclick="fillExample('SOL')">SOL</span>
                </div>
            </form>
        </div>
        
        <div class="loading" id="loading">
            <div class="spinner"></div>
            <p class="text-white">正在获取数据...</p>
        </div>

        
        <div class="card crypto-card">
            <div class="card-header">
                <div class="pair-info">
                    <h3 class="pair-symbol">
                        <i class="fab fa-bitcoin"></i>
                        BTC/USDT
                        
                    </h3>
                    <p class="pair-name">
                        BTC
                        <span class="text-muted ms-2">
                            <i class="fas fa-database"></i> 数据源: CryptoCompare
                        </span>
                    </p>
                </div>
            </div>
            
            <div class="price-section">
                <div class="current-price">$114,349.34</div>
                <div class="price-change change-positive">
                    <i class="fas fa-arrow-up me-1"></i>
                    +0.32%
                </div>
            </div>
            
            
            <div class="additional-info">
                <div class="info-item">
                    <div class="info-label">24小时最高</div>
                    <div class="info-value">$114752.73</div>
                </div>
                <div class="info-item">
                    <div class="info-label">24小时最低</div>
                    <div class="info-value">$113457.52</div>
                </div>
            </div>
            
            
            
            <!-- 技术分析区域 -->
            <div class="technical-analysis-section">
                <div class="section-header">
                    <h4><i class="fas fa-chart-line me-2"></i>技术分析指标</h4>
                    <small class="text-muted">基于最近30天数据计算</small>
                </div>
                
                <!-- 主要指标 -->
                <div class="main-indicators">
                    
                    <div class="indicator-card">
                        <div class="indicator-name">RSI (14)</div>
                        <div class="indicator-value">46.28</div>
                        <div class="indicator-signal signal-neutral">
                            中性
                        </div>
                    </div>
                    
                    
                    
                    <div class="indicator-card">
                        <div class="indicator-name">MACD</div>
                        <div class="indicator-value">-344.04</div>
                        <div class="indicator-signal signal-bearish">
                            看跌
                            
                        </div>
                    </div>
                    
                    
                    
                    <div class="indicator-card">
                        <div class="indicator-name">布林带</div>
                        <div class="indicator-value">$132831.16</div>
                        <div class="indicator-signal signal-neutral">中轨</div>
                    </div>
                    
                    
                    
                    <div class="indicator-card">
                        <div class="indicator-name">SMA (20)</div>
                        <div class="indicator-value">$132831.16</div>
                        <div class="indicator-signal signal-neutral">均线</div>
                    </div>
                    
                </div>
                
                <!-- 详细指标 -->
                <div class="detailed-indicators">
                    <div class="row">
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">EMA (12):</span>
                                <span class="detail-value">$133326.62</span>
                            </div>
                        </div>
                        
                        
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">EMA (26):</span>
                                <span class="detail-value">$131898.32</span>
                            </div>
                        </div>
                        
                        
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">Stochastic K:</span>
                                <span class="detail-value">22.88</span>
                            </div>
                        </div>
                        
                        
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">Williams %R:</span>
                                <span class="detail-value">-77.12</span>
                            </div>
                        </div>
                        
                        
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">CCI:</span>
                                <span class="detail-value">-48.71</span>
                            </div>
                        </div>
                        
                        
                        
                        <div class="col-6">
                            <div class="detail-item">
                                <span class="detail-label">Momentum:</span>
                                <span class="detail-value">98.31</span>
                            </div>
                        </div>
                        
                    </div>
                </div>
                
                <!-- 综合信号 -->
                <div class="overall-signal">
                    <div class="signal-title">综合交易信号</div>
                    <div class="signal-content">
                        
                        
                        
                        
                        
                        
                            <div class="overall-signal-badge signal-bearish">
                                <i class="fas fa-arrow-down me-1"></i>偏向看跌
                            </div>
                        
                        
                        <div class="signal-breakdown">
                            看涨: 0 | 看跌: 1 
                            
                            
                        </div>
                    </div>
                </div>
                
                <!-- 性能信息 -->
                <div class="analysis-info">
                    <small class="text-muted">
                        <i class="fas fa-info-circle me-1"></i>
                        分析数据点: 100 | 
                        计算耗时: 21.6ms
                    </small>
                </div>
            </div>
            
            
            <div class="last-updated">
                <i class="fas fa-clock me-1"></i>
                最后更新: 2025-09-11 22:06:10
            </div>
        </div>
        

        
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        function fillExample(example) {
            document.getElementById('coinInput').value = example;
        }
        
        document.getElementById('searchForm').addEventListener('submit', function() {
            document.getElementById('loading').style.display = 'block';
        });
        
        // 自动隐藏加载动画
        window.addEventListener('load', function() {
            document.getElementById('loading').style.display = 'none';
        });
    </script>
</body>
</html>